#include<iostream>


//仿函数：让类的对象像函数一样调用
class Func
{
public:
    Func(int c):c(c){}
    int operator()(int a,int b)
    {
        return a+b+c;
    }
private:
    int c;
};

int add(int a,int b)
{
    return a+b;
}
void func(Func&f,int a,int b)
{
    std::cout<<f(a,b)<<std::endl;
}

int main()
{
    Func F(3);
    std::cout<<F(1,2)<<std::endl;
    
    return 0;
}